feat(rendering): force dynamic rendering for all (app) routes#27
Merged
itinsecurity merged 5 commits intomainfrom Mar 19, 2026
Merged
feat(rendering): force dynamic rendering for all (app) routes#27itinsecurity merged 5 commits intomainfrom
itinsecurity merged 5 commits intomainfrom
Conversation
Add `export const dynamic = 'force-dynamic'` to all four files in the authenticated (app) route group so Next.js renders them at request time instead of statically pre-rendering during `next build`. This allows the application to build successfully without a database being available. Also adds a Playwright E2E test that verifies the holdings page serves fresh data after an update without requiring a rebuild. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Scope row selector to uniqueAccount instead of /DYNTEST/ to avoid strict mode violations when prior runs leave DYNTEST rows in the DB - Wait for the Edit button to reappear after saving (proves the server action completed) before navigating to /holdings Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Playwright name matching is substring by default; "Open in editor" buttons injected by the dev toolbar match /edit/i, causing a strict mode violation. Adding exact: true constrains the locator to the button with accessible name exactly "Edit". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Next.js 16 forbids non-async-function exports from "use server" files. EDITABLE_PROFILE_FIELDS is a constant array, not a function, so it violates this constraint and crashes the holding detail page at runtime. Move the constant to src/lib/profileFields.ts (a plain module with no "use server" directive) and import it in profiles.ts and the test file. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
getByText(updatedAccount) matches both the account filter <option> and
the table <td>, causing a strict mode violation. getByRole("cell") only
matches table cells, not option elements.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
export const dynamic = 'force-dynamic'to all four files in the authenticated(app)route group (layout.tsx,holdings/page.tsx,holdings/[id]/page.tsx,portfolio/page.tsx)DATABASE_URLis not set at build time — Next.js no longer attempts to statically pre-render pages that call Prismatests/e2e/dynamic-rendering.spec.ts) verifying the holdings page serves fresh data after an update without a rebuildTest plan
npm run buildwithDATABASE_URLunset completes with zero errors;(app)routes showƒ (Dynamic)in build outputnpx tsc --noEmit— 0 errorsnpm run test— 101 tests passingnpm run test:e2e— dynamic-rendering spec passes (add holding → update account name → full page nav → fresh data visible)🤖 Generated with Claude Code